/*    */
package com.xj.common.bean;
/*    */
/*    */

import com.fasterxml.jackson.annotation.JsonInclude;
/*    */ import java.io.Serializable;

/*    */
/*    */ public class NewR<T> implements Serializable {
    /*    */   private static final long serialVersionUID = 1L;

    /*    */
    /*    */
    public void setId(int id) {
        /* 10 */
        this.id = id;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof NewR)) return false;
        NewR<?> other = (NewR) o;
        if (!other.canEqual(this)) return false;
        if (getId() != other.getId()) return false;
        if (getCode() != other.getCode()) return false;
        Object this$message = getMessage(), other$message = other.getMessage();
        if ((this$message == null) ? (other$message != null) : !this$message.equals(other$message)) return false;
        Object this$body = getBody(), other$body = other.getBody();
        return !((this$body == null) ? (other$body != null) : !this$body.equals(other$body));
    }

    protected boolean canEqual(Object other) {
        return other instanceof NewR;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + getId();
        result = result * 59 + getCode();
        Object $message = getMessage();
        result = result * 59 + (($message == null) ? 43 : $message.hashCode());
        Object $body = getBody();
        return result * 59 + (($body == null) ? 43 : $body.hashCode());
    }

    public String toString() {
        return "NewR(id=" + getId() + ", message=" + getMessage() + ", code=" + getCode() + ", body=" + getBody() + ")";
    }

    /*    */
    public NewR(int id, String message, int code, T body) {
        /* 12 */
        this.id = id;
        this.message = message;
        this.code = code;
        this.body = body;
        /*    */
    }

    /*    */
    /* 15 */   private int id = 1;
    private String message;

    public int getId() {
        return this.id;
    }

    public String getMessage() {
        /* 16 */
        return this.message;
        /* 17 */
    }

    private int code = Code.OK.getCode();

    public int getCode() {
        return this.code;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    /*    */ private T body;

    public T getBody() {
        /* 19 */
        return this.body;
        /*    */
    }

    /*    */
    /*    */
    public NewR(T body) {
        /* 23 */
        this.body = body;
        /*    */
    }

    /*    */
    /*    */
    /*    */
    public static <T> NewR<T> fail(int id, String message, T data) {
        /* 28 */
        return (new NewR<>(data)).failure(id, message, data);
        /*    */
    }

    /*    */
    /*    */
    /*    */
    public static <T> NewR<T> ok(int id, String message, T data) {
        /* 33 */
        return (new NewR<>(data)).success(id, message, data);
        /*    */
    }

    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    private NewR success(int id, String message, T data) {
        /* 43 */
        this.id = id;
        /* 44 */
        this.code = Code.OK.getCode();
        /* 45 */
        this.message = message;
        /* 46 */
        this.body = data;
        /* 47 */
        return this;
        /*    */
    }

    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    /*    */
    private NewR failure(int id, String message, T data) {
        /* 58 */
        this.id = id;
        /* 59 */
        this.message = message;
        /* 60 */
        this.code = Code.FAILURE.getCode();
        /* 61 */
        this.body = data;
        /* 62 */
        return this;
        /*    */
    }

    /*    */
    public NewR() {
    }

    /*    */
    /* 66 */   public enum Code {
        OK(2000), FAILURE(4000), NotFound(3404);
        private int code;

        public int getCode() {
            /* 67 */
            return this.code;
            /*    */
        }

        /*    */
        /*    */     Code(int code) {
            /* 71 */
            this.code = code;
            /*    */
        }
    }
    /*    */
    /*    */
}


/* Location:              C:\Users\Administrator\Desktop\fsdownload\ie-data.jar!\BOOT-INF\lib\ie-base-1.0-SNAPSHOT.jar!\com\xj\common\bean\NewR.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */